package com.atguigu2.two.exer1;

/**
 * ClassName: dilatation
 * Package: com.atguigu2.two.exer2
 * Description:
 *              数组的扩容和缩容
 * @Author BuTang
 * @Create 2023/2/23 20:43
 * @Version 1.0
 */
public class dilatation {
    public static void main(String[] args) {

      /*
              int[] arr = new int[6];
        int[] arr1 = new int[arr.length<<1];
        arr =arr1;
        /*
       */
        int[] arr = new int[]{10,11,12,13,14,15,16,17,18};
        int deleteIndex = 4;
        for (int i = deleteIndex ;i < arr.length-1; i++) {
            arr[i]=arr[i+1];
        }
            int[] newArr =new int[arr.length-1];
        for (int i = 0; i < arr.length- 1; i++) {
            newArr[i] = arr[i];
        }
            arr =newArr;

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

    }
}
